package com.test.daily.leetcode.y2021.m10.day1023;

/**
 * @descriptions:
 * @author: Tom
 * @date: 2021/10/23 下午 03:36
 * @version: 1.0
 */
public class Code01_ConstructRetangle {
    public static void main(String[] args) {
        int area = 6;
        Code01_ConstructRetangle cc = new Code01_ConstructRetangle();
        int[] ans = cc.constructRectangle(area);
        System.out.println(ans[0] + "＊" + ans[1]);
    }

    public int[] constructRectangle(int area) {
        int[] ans = new int[2];
        for(int i = (int)Math.sqrt(area); i >=1; i--){
            if(area % i == 0){
                ans[1] = i;
                break;
            }
        }
        ans[0] = area / ans[1];
        return ans;
    }
}
